﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework.Input;

namespace Obsidian.Input
{
    using XnaKeys = Microsoft.Xna.Framework.Input.Keys;

    // this is to hold all possible buttons and axis input available to Obsidian
    public enum ObsidianButton
    {
        #region Mouse Axis & Buttons

        /// <summary>
        /// Left Mouse Button
        /// </summary>
        LeftMouseButton,

        /// <summary>
        /// Right Mouse Button
        /// </summary>
        RightMouseButton,

        /// <summary>
        /// Middle Mouse Button
        /// </summary>
        MiddleMouseButton,

        /// <summary>
        /// Horizontal Mouse Axis
        /// </summary>
        MouseX,

        /// <summary>
        /// Vertical Mouse Axis
        /// </summary>
        MouseY,

        /// <summary>
        /// Mouse Wheel Delta
        /// </summary>
        MouseW,

        #endregion

        #region Arrow Keys

        /// <summary>
        /// Left Arrow Key
        /// </summary>
        Left,

        /// <summary>
        /// Right Arrow Key
        /// </summary>
        Right,

        /// <summary>
        /// Up Arrow Key
        /// </summary>
        Up,

        /// <summary>
        /// Down Arrow Key
        /// </summary>
        Down,

        #endregion
    }

   

    // takes an ObsidianButton and returns an XNA variable
    internal class ButtonMapper : Dictionary<ObsidianButton, int>
    {
        // init all the names ...
        internal ButtonMapper()
        {
            // arrow keys
            this.Add(ObsidianButton.Left, (int)XnaKeys.Left);

            // mouse buttons
            this.Add(ObsidianButton.LeftMouseButton, (int)MouseButton.Left);
            this.Add(ObsidianButton.RightMouseButton, (int)MouseButton.Right);
            this.Add(ObsidianButton.MiddleMouseButton, (int)MouseButton.Middle);
        }
    }
}
